<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>后台管理系统</title>
<meta name="description" content="这是一个 index 页面">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="/Public/assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="/Public/assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="/Public/assets/css/amazeui.min.css"/>
<link rel="stylesheet" href="/Public/assets/css/admin.css">
<link rel="stylesheet" type="text/css" href="/Public/style/style.css">
<script src="/Public/assets/js/jquery.min.js"></script>
<script src="/Public/assets/js/app.js"></script>
</head>
<body>
<!--[if lte IE 9]><p class="browsehappy">升级你的浏览器吧！ <a href="http://se.360.cn/" target="_blank">升级浏览器</a>以获得更好的体验！</p><![endif]-->
</head>

<body>
<header class="am-topbar admin-header" style="height:100px;padding-top:15px;background:#f5faf5;">
  <div class="am-topbar-brand" style="padding-left:70px;"><img src="/Public/assets/i/logo.png"></div>

  <div class="header-top"> <p>欢迎系统管理员： <span>admin</span></p>
<a href="<?php echo U('Index/index');?>">系统首页</a>
  <a href="<?php echo U('Home/Index/index');?>" target="_blank">网站首页</a> <a href="<?php echo U('Index/logout');?>">退出</a></div>
</header>

<div class="am-cf admin-main"> 

<div class="nav-navicon admin-main admin-sidebar">
    <div class="sideMenu">
      <h3 class="am-icon-flag <?php if(in_array(CONTROLLER_NAME,array('Cate','Article','Recycle'))): ?>on<?php endif; ?>"><em></em> <a href="#">文章管理</a></h3>
      <ul>
        <li><a href="<?php echo U('Cate/index');?>">栏目管理</a></li>
        <li><a href="<?php echo U('Article/add');?>">添加文章</a></li>
        <li><a href="<?php echo U('Article/index');?>">文章管理</a></li>
        <li><a href="<?php echo U('Recycle/index');?>">	回收站管理</a></li>
      </ul>
      <h3 class="am-icon-cart-plus <?php if(CONTROLLER_NAME == Pict || CONTROLLER_NAME == PictCate): ?>on<?php endif; ?>"><em></em> <a href="#"> 图片管理</a></h3>
      <ul>
        <li><a href="<?php echo U('PictCate/index');?>">图片分类</a></li>
        <li><a href="<?php echo U('Pict/add');?>">图片添加</a></li>
        <li><a href="<?php echo U('Pict/index');?>">图片管理</a></li>
      </ul>
      <h3 class="am-icon-users <?php if(CONTROLLER_NAME == Msg): ?>on<?php endif; ?>"><em></em> <a href="#">在线留言</a></h3>
      <ul>
        <li><a href="<?php echo U('Msg/index');?>">在线留言</a> </li>
      </ul>
      <h3 class="am-icon-gears <?php if(in_array(CONTROLLER_NAME,array('Config','Link','Admin','AuthGroup','AuthRule'))): ?>on<?php endif; ?>"><em></em> <a href="#">系统设置</a></h3>
      <ul>
        <li><a href="<?php echo U('Config/index');?>">系统设置</a></li>
        <li><a href="<?php echo U('Link/index');?>">友情链接</a></li>
        <!-- <li><a href="<?php echo U('Admin/index');?>">管理员管理</a></li>
        <li><a href="<?php echo U('AuthGroup/index');?>">角色管理</a></li>
        <li><a href="<?php echo U('AuthRule/index');?>">权限管理</a></li> -->
      </ul>
      <h3 class="am-icon-volume-up"><em></em> <a href="#">网站信息</a></h3>
      <ul>
        <li><a href="<?php echo U('Home/Index/index');?>">网站首页</a></li>
      </ul>
    </div>
    <!-- sideMenu End --> 
    
    <script type="text/javascript">
			jQuery(".sideMenu").slide({
				titCell:"h3", //鼠标触发对象
				targetCell:"ul", //与titCell一一对应，第n个titCell控制第n个targetCell的显示隐藏
				effect:"slideDown", //targetCell下拉效果
				delayTime:300 , //效果时间
				triggerTime:150, //鼠标延迟触发时间（默认150）
				defaultPlay:true,//默认是否执行效果（默认true）
				returnDefault:true //鼠标从.sideMen移走后返回默认状态（默认false）
				});
		</script> 
</div>
<div class=" admin-content">
<div class="daohang"></div>
<div class="admin-biaogelist">
	
    <div class="listbiaoti am-cf">
      <ul class="am-icon-flag on"> 留言管理</ul>
      
      <dl class="am-icon-home" style="float: right;"> 当前位置： <a href="<?php echo U('Index/index');?>">首页</a> > <a href="<?php echo U('Msg/index');?>">留言管理</a> > 留言列表</dl>
    </div>
    <form class="am-form am-g" id="cont_form">
          <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
            <thead>
              <tr class="am-success">
                <th></th>
                <th class="table-id">ID</th>
                <th class="table-title">联系人</th>
                <th class="table-type">手机</th>
                <th class="table-type">电话</th>
                <th class="table-date am-hide-sm-only">留言日期</th>
                <th width="163px" class="table-set">操作</th>
              </tr>
            </thead>
            <tbody>
            <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                <td><input type="checkbox" name="id[]" value="<?php echo ($vo["id"]); ?>" /></td>
                <td><?php echo ($vo["id"]); ?></td>
                <td><?php echo ($vo["name"]); ?></td>
                <td><?php echo ($vo["phone"]); ?></td>
                 <td><?php echo ($vo["tel"]); ?></td>
                <td class="am-hide-sm-only"><?php echo date('Y-m-d H:m:s',$vo['ctime']);?></td>
                <td><div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <a href="<?php echo U('info',array('id'=>$vo['id']));?>" class="am-btn am-btn-default am-btn-xs am-text-secondary am-round">查看</a>
                      <button type="button" onclick="del(<?php echo ($vo["id"]); ?>)" class="am-btn am-btn-default am-btn-xs am-text-danger am-round">删除</button>
                    </div>
                  </div></td>
              </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
          </table>
          <div class="am-btn-group am-btn-group-xs">
              <input type="checkbox" id="checkall"> 全选
            </div>
          
                 <div class="am-btn-group am-btn-group-xs">
              <button id="alldel" type="button" class="am-btn am-btn-red">批量删除</button>
            </div>
            <?php echo ($show); ?>
          
          <!-- <ul class="am-pagination am-fr">
                <li class="am-disabled"><a href="#">«</a></li>
                <li class="am-active"><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li><a href="#">»</a></li>
              </ul> -->
          
        </form>
 <script type="text/javascript">
   //单个删除
  function del(id){
    if(!confirm('确定要删除吗？')){
      return false;
    }
    $.ajax({
      url : "<?php echo U('del');?>",
      data : {'id':id},
      type : 'post',
      dataType : 'json',
      success : function(res){
        if(res.status == 'OK'){
          alert(res.msg);
          location = "/Systemht/Msg/index.html";
        }
        else if(res.status == 'NO'){
          alert(res.msg);
        }
      }
    });
  }

  //批量删除
  $('#alldel').on('click',function(){
    var Checkbox = false;
    $("input[name='id[]']").each(function() {
      if(this.checked == true) {
        Checkbox = true;
      }
    });
    if(!Checkbox){
      alert('请选择要删除的内容');
      return false;
    }
    if(!confirm('确定要删除选中内容吗？')){
      return false;
    }
    var data = $("#cont_form").serialize()
    $.ajax({
      url : "<?php echo U('alldel');?>",
      data : data,
      type : 'post',
      dataType : 'json',
      success : function(res){
        if(res.status == 'OK'){
          alert(res.msg);
          location = "/Systemht/Msg/index.html";
        }
        else if(res.status == 'NO'){
          alert(res.msg);
        }
      }
    });
  })
  
  //全选
  $("#checkall").click(function() {
    if(this.checked){
      this.checked = true;
      $("input[name='id[]']").each(function() {
        this.checked = true;
      });
    }
    else{
      this.checked = false;
      $("input[name='id[]']").each(function() {
        this.checked = false;
      });
    }
    
  });

 </script>

</div>

</div>




</div>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="/Public/assets/js/polyfill/rem.min.js"></script>
<script src="/Public/assets/js/polyfill/respond.min.js"></script>
<script src="/Public/assets/js/amazeui.legacy.js"></script>
<![endif]--> 

<!--[if (gte IE 9)|!(IE)]><!--> 
<script src="/Public/assets/js/amazeui.min.js"></script>
<!--<![endif]-->



</body>
</html>